UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hoope6KDV+fx5yEqFW0CnIUWuowPddKlIl7UekYngmA='
WHERE
key_id = 'ba3d6766efd6a3c3c8627a867c60b847555e82febd7c5013f25affb6e0255565'
AND (
token = 'hoope6KDV+fx5yEqFW0CnIUWuowPddKlIl7UekYngmA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)