UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UREUsDMltqA1J8mASaNCNOVNSf0QKbZCCi5/PeRl8S8='
WHERE
key_id = 'cf8e08f3c8cfb6ab339afe9281bdad8f5580d4aa607ab1708984424f87111074'
AND (
token = 'UREUsDMltqA1J8mASaNCNOVNSf0QKbZCCi5/PeRl8S8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)