UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HP3i9gLTyRppzahEKPcJ+o4//XengVl7+wQh0NqONec='
WHERE
key_id = 'e45b6cbb234b208ff93f609c300234945b6f972559577cb7f2098700c8410760'
AND (
token = 'HP3i9gLTyRppzahEKPcJ+o4//XengVl7+wQh0NqONec='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)