UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FFQJvRDwb5hV9EuDjbMjAWJgaq96LSVPRyOdO8cNfY8='
WHERE
key_id = 'fbb3f0a605bb5b3832fb9d1ae90ea2c209d0b0b641b15976afeee551309363ba'
AND (
token = 'FFQJvRDwb5hV9EuDjbMjAWJgaq96LSVPRyOdO8cNfY8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)