UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vwQxvTgnbOFtp8QBuomnvQe2QwaOvn3lCIr3qL/8WeY='
WHERE
key_id = 'fd6706e6a2c96ae8a95cdcd98e6fef80e00521ce921b2ef22a1e7666bc667f24'
AND (
token = 'vwQxvTgnbOFtp8QBuomnvQe2QwaOvn3lCIr3qL/8WeY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)