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