UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8Y8mqZBYVoXgPmw0xznJPfe576w+ApZOuTSvhBabadg='
WHERE
key_id = 'c79f8c939494522dca3dc827286ac47e06fc6fb6ab6e08ac2c381a444b329bbf'
AND (
token = '8Y8mqZBYVoXgPmw0xznJPfe576w+ApZOuTSvhBabadg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)