UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iIqatjBw4iV0U4vArRdp8Z0b9cfxR/RHvmhviSqTyuo='
WHERE
key_id = 'eef40ba7afd42ee99f35c37bdf5ff20b31918b0fddfd1269fc3f20ae74aa4648'
AND (
token = 'iIqatjBw4iV0U4vArRdp8Z0b9cfxR/RHvmhviSqTyuo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)