UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nzmV+5aISB3+FX+W+lt2chYGZBIL9at/MFWsltCDpVw='
WHERE
key_id = 'a6cd21fbc4e6c8edbb3731245f6d814c4f936860ebd56fc47a325b5e9f778af7'
AND (
token = 'nzmV+5aISB3+FX+W+lt2chYGZBIL9at/MFWsltCDpVw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)