UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2knVBV2R1sAAmKsZ2AFL8eK4ACgX6k+miVrX9FJuvNA='
WHERE
key_id = '807d178fc2a4cced1e299b4885ea55854d7a6a69e131c4b45bec4f2ec60b6f4a'
AND (
token = '2knVBV2R1sAAmKsZ2AFL8eK4ACgX6k+miVrX9FJuvNA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)