UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kOa26Djg5KH0jZarUjojOx8726BEtmGoZdTK8KDbDos='
WHERE
key_id = '7a7e0a12f46c9e1ef9888a026ec3ab4c873c4935c4f936c112c17f95cb1c853b'
AND (
token = 'kOa26Djg5KH0jZarUjojOx8726BEtmGoZdTK8KDbDos='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)