UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ynexx3V1IuTS1jC9qeffjAdcgmOGvDB2iJ4Lof6/KWE='
WHERE
key_id = '875081975392f36226607cb3d5895bc765b34ff40156ca53b9104fcad78e9474'
AND (
token = 'ynexx3V1IuTS1jC9qeffjAdcgmOGvDB2iJ4Lof6/KWE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)