UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZyU2T3NJYfWp73+j//SY+FoV8rAjW50jGWoNoDBkcVc='
WHERE
key_id = '64413e1511ada5e63fbe23408ba3fde8522f3328e8f903eac1eb596dc5008000'
AND (
token = 'ZyU2T3NJYfWp73+j//SY+FoV8rAjW50jGWoNoDBkcVc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)