UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vupWWg9I1munRIHAE7N44jIxSjm7zVz6lzi5yCu/gjg='
WHERE
key_id = 'a152a531cd214d35e3c6ae0540ff68fb3fecf743d16b2a7939c1c9258097abd3'
AND (
token = 'vupWWg9I1munRIHAE7N44jIxSjm7zVz6lzi5yCu/gjg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)