UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AKNVVahboN8pu3VcBD9KMD0/1aooxwSn3YkqpDfXZ88='
WHERE
key_id = 'ca300919f024fe983df955525b72f5f62dcafc02e35633d1e133d211480b2515'
AND (
token = 'AKNVVahboN8pu3VcBD9KMD0/1aooxwSn3YkqpDfXZ88='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)