UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7KjGktE8wopza8H6t72kgjyhH2tkZINlTq9rcY6zrq0='
WHERE
key_id = 'dc72751503befa697de2e482cc5ddb3641ac3c92f47cf47710fc93e009ff58f0'
AND (
token = '7KjGktE8wopza8H6t72kgjyhH2tkZINlTq9rcY6zrq0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)