UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WBpwLtWeaqV+FlQfM6LfE+jWxQqZtFYHbHUfCgVxo+g='
WHERE
key_id = 'f3b363adc635206c301013e40b2cd5a3e8543c2a9b0bde53f6704ad2ad8a72eb'
AND (
token = 'WBpwLtWeaqV+FlQfM6LfE+jWxQqZtFYHbHUfCgVxo+g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)