UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ADOSeS6Q63176sbi6v6EfcQCM1lknWXZJ5T+YqebDqY='
WHERE
key_id = '94456099f45b42b0a89b70595501a1bc145d4ae5d8ad971152302d8e6da74ae5'
AND (
token = 'ADOSeS6Q63176sbi6v6EfcQCM1lknWXZJ5T+YqebDqY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)