UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hIspkKssRaKnZgwYZKCxOmhmYZapy2++hK/brIbLWbE='
WHERE
key_id = '1a123f30bf2757cbdfff6681ca5657ec4b5e9d7a88114170c79423eedb0d69d0'
AND (
token = 'hIspkKssRaKnZgwYZKCxOmhmYZapy2++hK/brIbLWbE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)