UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YOYdEO/3A3v2/O/JjmUFcwRdI0udIaayPQipotN5ne4='
WHERE
key_id = 'f0654f9e2cd8abf47fb782d859bd5af70500db0b8aa2fa4ca6013f3437af36c4'
AND (
token = 'YOYdEO/3A3v2/O/JjmUFcwRdI0udIaayPQipotN5ne4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)