UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oGQZvRPvHyPq21TY5ACx4M/lOIp7hbXyS24ZMklhC7g='
WHERE
key_id = '0238626b0a723b6a6e06bba70da4014ac166ba5bf2053e6511582cd22963f267'
AND (
token = 'oGQZvRPvHyPq21TY5ACx4M/lOIp7hbXyS24ZMklhC7g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)