UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nRho56i54wMNmhHLzFxqxHWuPoUk0QWAsml/IW4uGP4='
WHERE
key_id = '160a5146c7f9c6b946bfcce802f5bd9104e18c20672a228873336603034316a9'
AND (
token = 'nRho56i54wMNmhHLzFxqxHWuPoUk0QWAsml/IW4uGP4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)