UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'J2kA5ZmbJYhUAyqZOIyM3B6569gUcFQXQ2kWfB2CZ/c='
WHERE
key_id = 'c32ad40536b6ecc57d442deaa46c60f1737f3a430d4453c695da9443106b13a3'
AND (
token = 'J2kA5ZmbJYhUAyqZOIyM3B6569gUcFQXQ2kWfB2CZ/c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)