UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mWX/Rnk1kBI9XKARdWiPWhTRnCVpB/loFK2hVXnPMSg=' 
WHERE 
  key_id = '88725f363c4e7441bcf3d72e2ded6fde6acf042a18608f560c59da8bf08c8435' 
  AND (
    token = 'mWX/Rnk1kBI9XKARdWiPWhTRnCVpB/loFK2hVXnPMSg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031