UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fiQaSARP0GnZT87EzW2S6uR09/ySKa1qrZHSM0cABbA='
WHERE
key_id = '99300b060cdd5a03b30e1aa4a659df5a903edd210a3fae9b11b13178dfa94b05'
AND (
token = 'fiQaSARP0GnZT87EzW2S6uR09/ySKa1qrZHSM0cABbA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)