UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8mmVP2yaCWQhOWPZflO6cT9UFkVEz9i12qbvyYposqo='
WHERE
key_id = 'd83e24b3122aae237ab030c27e97b6464426d20edc034b5da8a66382b8fac156'
AND (
token = '8mmVP2yaCWQhOWPZflO6cT9UFkVEz9i12qbvyYposqo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)