UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Qz716Fy4eiAPgu5wILdoMZP6jKq6F9UsXR4OPN/TRtM='
WHERE
key_id = '7144ebaaba3ecfc34ca04098184982899a1965cbfebadd49914d98e0332deecb'
AND (
token = 'Qz716Fy4eiAPgu5wILdoMZP6jKq6F9UsXR4OPN/TRtM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)