UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Af9UouOCVzT7s4ndi1Go/E/Fso7pKJcrFNmTXsOzlVE='
WHERE
key_id = 'b751cd8775896e22f23d748fa7b257ab947c991ad3c1fb395e76b3ead36aee5c'
AND (
token = 'Af9UouOCVzT7s4ndi1Go/E/Fso7pKJcrFNmTXsOzlVE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)