UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E8qM5DAIn2AdSCE7hoXf2IdeX6s1zZ2iiQEBWFXuL7c='
WHERE
key_id = '89c07ce7bd1a0dd5e92261a712f7fc8acae705ffe50a2fe07a1598d5c9cdb580'
AND (
token = 'E8qM5DAIn2AdSCE7hoXf2IdeX6s1zZ2iiQEBWFXuL7c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)