UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JAMzLPOrIjbbOmXLtd/sPzDEUE1taPdxocdokI0cWaU='
WHERE
key_id = '9a191058e8dc9830ad7680e882c1cd7c1665ee85a211b67bd7fbd2df778b8787'
AND (
token = 'JAMzLPOrIjbbOmXLtd/sPzDEUE1taPdxocdokI0cWaU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)