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