UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xCOKg7K8KUg3YUSjuWUSoBIJsgQTw/ckiU+evZ6/2O0='
WHERE
key_id = '2703f4d21acd0251c9f11e1277b02e6d8ef910bb457b5404855e5b5bdec6c59e'
AND (
token = 'xCOKg7K8KUg3YUSjuWUSoBIJsgQTw/ckiU+evZ6/2O0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)