UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NBAc8uUGX0wakOWJu5LlVN4afARme69LqfUOOm0edsI='
WHERE
key_id = '08c48fd967e5b6ea0c73aa4fa81a3e8335b608b99a29b0656ed98e78456731ad'
AND (
token = 'NBAc8uUGX0wakOWJu5LlVN4afARme69LqfUOOm0edsI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)