UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7zXpSjtluaM/4nm/6oSiTky2A4gOgxGBrKlRQ0pQ4O4='
WHERE
key_id = '0413492f0a7f23713ce83c77392b44d12f71d64afbef5c515fc1867b08196cb6'
AND (
token = '7zXpSjtluaM/4nm/6oSiTky2A4gOgxGBrKlRQ0pQ4O4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)