UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'T+/8mNDq/ww+COUQv1N1LgKi34zYYB47AwCV7HVB0Ic='
WHERE
key_id = 'b91f5c39692731149a4e10b6296123f0a9cc82a21aceffcce75d62229c7acc3b'
AND (
token = 'T+/8mNDq/ww+COUQv1N1LgKi34zYYB47AwCV7HVB0Ic='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)