UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MF1/DQWaEpiX/pZ1zIQWi9BnpF40grca08lU8I/tB3g='
WHERE
key_id = '29c0286b82cd9f4859d57a438cab17606aad16e84dc21066823fc4471d81aaec'
AND (
token = 'MF1/DQWaEpiX/pZ1zIQWi9BnpF40grca08lU8I/tB3g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)